﻿<Window x:Class="FluidKit.Showcase.CustomShapesWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:Shapes="clr-namespace:FluidKit.Shapes;assembly=FluidKit"
		SizeToContent="WidthAndHeight"
		Title="CustomShapes - FluidKit">
	<Window.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="CustomShapes_Resources.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</Window.Resources>
	<TabControl>

		<!-- ################################## CogwheelShape Tab #########################################################-->

		<TabItem Header="CogWheelShape"
				 Tag="{Binding ElementName=cogwheelContainer, Path=Content}"
				 HeaderTemplate="{StaticResource HeaderTemplate}">
			<DockPanel>

				<StackPanel DockPanel.Dock="Left"
							VerticalAlignment="Center"
							HorizontalAlignment="Center"
							Margin="10,0,0,0">

					<HeaderedContentControl Header="Teeth:">
						<Slider x:Name="TeethSlider"
								Value="5"
								Minimum="2"
								Maximum="50" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="Thickness:">
						<Slider  x:Name="ThicknessSlider"
								 Value="2"
								 Minimum="0"
								 Maximum="10"
								 TickFrequency="0.5" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="InnerRadiusOffset:">
						<Slider x:Name="InnerRadiusOffsetSlider"
								Value="20"
								Minimum="0"
								Maximum="100"
								TickFrequency="5" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="MiddleRadiusOffset:">
						<Slider x:Name="MiddleRadiusOffsetSlider"
								Value="20"
								Minimum="0"
								Maximum="100"
								TickFrequency="5" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="Bevel:">
						<Slider x:Name="BevelSlider"
								Value="20"
								Minimum="0"
								Maximum="100"
								TickFrequency="5" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="RotationAngle:">
						<Slider x:Name="RotationAngleSlider"
								Value="0"
								Minimum="0"
								Maximum="360"
								TickFrequency="5" />
					</HeaderedContentControl>

				</StackPanel>

				<Grid>

					<Rectangle />
					<Ellipse />
					<ContentControl x:Name="cogwheelContainer">

						<Shapes:CogWheelShape Opacity="1"
											  Fill="#FFE81900"
											  Stroke="Black"
											  Teeth="{Binding ElementName=TeethSlider, Path=Value}"
											  StrokeThickness="{Binding ElementName=ThicknessSlider, Path=Value}"
											  InnerRadiusOffset="{Binding ElementName=InnerRadiusOffsetSlider, Path=Value}"
											  MiddleRadiusOffset="{Binding ElementName=MiddleRadiusOffsetSlider, Path=Value}"
											  Bevel="{Binding ElementName=BevelSlider, Path=Value}"
											  RotationAngle="{Binding ElementName=RotationAngleSlider, Path=Value}" />
					</ContentControl>
				</Grid>
			</DockPanel>
		</TabItem>

		<!-- ################################## PolygonShape Tab #########################################################-->

		<TabItem Header="PolygonShape"
				 Tag="{Binding ElementName=polygonContainer, Path=Content}"
				 HeaderTemplate="{StaticResource HeaderTemplate}">

			<DockPanel>

				<StackPanel DockPanel.Dock="Left"
							VerticalAlignment="Center"
							HorizontalAlignment="Center"
							Margin="10,0,0,0">

					<HeaderedContentControl Header="Corners:">
						<Slider x:Name="CornerSlider"
								Value="3"
								Minimum="3"
								Maximum="50" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="Thickness:">
						<Slider  x:Name="PolygonThicknessSlider"
								 Value="2"
								 Minimum="0"
								 Maximum="10"
								 TickFrequency="0.5" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="InnerRadiusOffset:">
						<Slider x:Name="PolygonInnerRadiusOffsetSlider"
								Value="0"
								Minimum="0"
								Maximum="200"
								TickFrequency="5" />
					</HeaderedContentControl>

					<HeaderedContentControl Header="RotationAngle:">
						<Slider x:Name="PolygonRotationAngleSlider"
								Value="0"
								Minimum="0"
								Maximum="360"
								TickFrequency="5" />
					</HeaderedContentControl>

				</StackPanel>

				<Grid Grid.Column="1"
					  DockPanel.Dock="Left"
					  VerticalAlignment="Center"
					  HorizontalAlignment="Center">

					<Rectangle />
					<Ellipse />
					<ContentControl x:Name="polygonContainer">
						<Shapes:PolygonShape Grid.Row="5"
											 Fill="#FF009600"
											 Stroke="Black"
											 Opacity="1"
											 InnerRadiusOffset="{Binding ElementName=PolygonInnerRadiusOffsetSlider, Path=Value}"
											 StrokeThickness="{Binding ElementName=PolygonThicknessSlider, Path=Value}"
											 CornerPoints="{Binding ElementName=CornerSlider, Path=Value}"
											 RotationAngle="{Binding ElementName=PolygonRotationAngleSlider, Path=Value}" />
					</ContentControl>
				</Grid>
			</DockPanel>
		</TabItem>

	</TabControl>
</Window>